﻿using DapperExtensions.Mapper;
using Newtonsoft.Json;

namespace ZilLion.Service.WeChatMall.Domain.Entitys.ShopInfo
{
    public class OfflineShopEntity
    {
        /// <summary>
        ///     分支机构id
        /// </summary>
        [JsonProperty("shopid")]
        public int Shopid { get; set; }

        /// <summary>
        ///     显示名称
        /// </summary>
        [JsonProperty("shopname")]
        public string ShopName { get; set; }

        /// <summary>
        ///     联系电话
        /// </summary>
        [JsonProperty("shopphone")]
        public string ShopPhone { get; set; }

        /// <summary>
        ///     地址
        /// </summary>
        [JsonProperty("shopaddress")]
        public string ShopAddress { get; set; }

        /// <summary>
        ///     索引码
        /// </summary>
        [JsonProperty("shopindexcode")]
        public string ShopIndexCode { get; set; }
        /// <summary>
        /// 是否禁用
        /// </summary>
        [JsonProperty("shopisforbidden")]
        public short ShopIsForbidden { get; set; }
    }

    public class OfflineShopEntityMapper : ClassMapper<OfflineShopEntity>
    {
        public OfflineShopEntityMapper()
        {
            Table("waibztjga");
            Map(f => f.Shopid).Column("fzjgid").Key(KeyType.Assigned);
            Map(f => f.ShopName).Column("fzjgqc");
            Map(f => f.ShopPhone).Column("fzjglxdh");
            Map(f => f.ShopAddress).Column("fzjglxdz");
            Map(f => f.ShopIndexCode).Column("fzjgsym");
            Map(f => f.ShopIsForbidden).Column("fzjgisforbidden");
        }
    }
}